import request from '@/utils/request'

const api_name = '/eduservice/course'

export default {
    saveCourseInfo(courseInfo) {
      return request({
        url: `${api_name}/saveCourseInfo`,
        method: 'post',
        data: courseInfo
      })
  },
  getCourseInfo(id) {
    return request({
      url: `${api_name}/getCourseInfo/${id}`,
      method: 'get'
    })
  },
  updateCourseInfoById(courseInfo) {
    return request({
      url: `${api_name}/updateCourseInfo/${courseInfo.id}`,
      method: 'put',
      data: courseInfo
    })
  },
  getCoursePublishInfoById(id) {
    return request({
      url: `${api_name}/coursePublishInfo/${id}`,
      method: 'get'
    })
  },
  publishCourse(id) {
    return request({
      url: `${api_name}/publishCourse/${id}`,
      method: 'put'
    })
  },
  getPageList(page,limit,searchObj) {
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: 'get',
      params:searchObj
    })
  },
  removeById(id) {
    return request({
      url: `${api_name}/${id}`,
      method: 'delete'
    })
  },
}
